{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import scipy.stats as ss\n",
    "import seaborn as sns"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 假设检验"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.75295476,  1.23743465,  1.22311872,  1.03186398,  0.02225342,\n",
       "       -1.5607541 ,  0.01890839, -1.56292672, -1.12690071, -0.13936368,\n",
       "        0.51524727,  1.21290744,  1.52412826,  0.67158692, -0.12853659,\n",
       "       -0.07320661,  0.68413995, -1.07913583,  0.34829248, -0.25102207])"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 20个符合正态分布的值\n",
    "norm_dist = ss.norm.rvs(size=20)\n",
    "norm_dist"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "NormaltestResult(statistic=1.4377483819665124, pvalue=0.4873005546205281)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 检验是否符合正态分布\n",
    "ss.normaltest(norm_dist)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Ttest_indResult(statistic=-1.5743362836198633, pvalue=0.1266426208728476)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# t分布检验\n",
    "ss.ttest_ind(ss.norm.rvs(size=10), ss.norm.rvs(size=20))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "检验统计量和P值。P值大于0.05, 也就是可以说假设成立，两分布均值没有差别"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(126.08080808080808, 2.9521414005078985e-29, 1, array([[55., 55.],\n",
       "        [45., 45.]]))"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 卡方检验\n",
    "ss.chi2_contingency([[15, 95], [85, 5]])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "F_onewayResult(statistic=17.619417475728156, pvalue=0.0002687153079821641)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# f检验\n",
    "ss.f_oneway([49, 50, 39, 40, 43],[28, 32, 30, 26, 34],[38, 40, 45, 42, 48])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "from statsmodels.graphics.api import qqplot\n",
    "from matplotlib import pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEKCAYAAAASByJ7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAGr5JREFUeJzt3X+QpHV94PH3Z0YU5zAaZrcST9kZCzki5hST8Qd6uVL0LooeFuaMMYusmrotICqmTEWvNucv3FJj4h2Kwq2FCtghIUfMGSXij4B45uK5KD/daBFhViK5uBAIyeYEdj/3x/O02zvbP57u6e6nu+f9qurq7md6+vlMwz6f/v76fCMzkSRpru4AJEmTwYQgSQJMCJKkkglBkgSYECRJJROCJAkwIUiSSiYESRJgQpAklR5RdwD92LRpUy4vL9cdhiRNlRtuuGFfZm7u9bqpSgjLy8vs3r277jAkaapExGqV19llJEkCTA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eSrweeAR5fnOp9hStZfXU5TIvj0ifkiRRM4GyMzvA1cCN1OMgXyrPH4f8DHgFuBPKMps99Ltb2nV6bP8QETcUn4+1wM3VTinZojVTqUxiogTgaspBnWvrjseqZUJQZIE2GUkSSqZECRJgAlBklQyIUiSABOCJKlkQpAkASYESVLp/wMItliE+vni5AAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 图检验是否符合正态分布\n",
    "plt.show(qqplot(ss.norm.rvs(size=100)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 相关系数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9333729600465923"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "s1 = pd.Series([0.1, 0.2, 1.1, 2.4, 1.3, 0.3, 0.5])\n",
    "s2 = pd.Series([0.5, 0.4, 1.2, 2.5, 1.1, 0.7, 0.1])\n",
    "# 对Seres求相关系数\n",
    "s1.corr(s2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.7142857142857144"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 斯皮尔曼相关系数\n",
    "s1.corr(s2, method='spearman')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.933373</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.933373</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          0         1\n",
       "0  1.000000  0.933373\n",
       "1  0.933373  1.000000"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 对df求相关系数，因为对列处理，所以要转置\n",
    "df=pd.DataFrame(np.array([s1,s2]).T)\n",
    "df.corr()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.714286</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.714286</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          0         1\n",
       "0  1.000000  0.714286\n",
       "1  0.714286  1.000000"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.corr(method='spearman')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 对于回归问题\n",
    "x=np.arange(10).astype(np.float).reshape((10, 1))\n",
    "y=x*3+np.random.random((10, 1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.],\n",
       "       [1.],\n",
       "       [2.],\n",
       "       [3.],\n",
       "       [4.],\n",
       "       [5.],\n",
       "       [6.],\n",
       "       [7.],\n",
       "       [8.],\n",
       "       [9.]])"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.38241749],\n",
       "       [ 3.02216578],\n",
       "       [ 6.03322823],\n",
       "       [ 9.66856137],\n",
       "       [12.9455134 ],\n",
       "       [15.8189476 ],\n",
       "       [18.94890963],\n",
       "       [21.33221138],\n",
       "       [24.67287576],\n",
       "       [27.70559378]])"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.28923468],\n",
       "       [ 3.34785863],\n",
       "       [ 6.40648258],\n",
       "       [ 9.46510652],\n",
       "       [12.52373047],\n",
       "       [15.58235441],\n",
       "       [18.64097836],\n",
       "       [21.69960231],\n",
       "       [24.75822625],\n",
       "       [27.8168502 ]])"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.linear_model import LinearRegression\n",
    "# 线性回归器\n",
    "reg = LinearRegression()\n",
    "# 对数据拟合\n",
    "res=reg.fit(x,y)\n",
    "# 产生预测值\n",
    "y_pred=reg.predict(x)\n",
    "y_pred"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[3.05862395]])"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 参数\n",
    "reg.coef_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.28923468])"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 截距\n",
    "reg.intercept_"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### PCA变换"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "data=np.array([np.array([2.5, 0.5, 2.2, 1.9, 3.1, 2.3, 2,   1,  1.5, 1.1]), \n",
    "               np.array([2.4, 0.7, 2.9, 2.2,  3,  2.7, 1.6, 1.1, 1.6, 0.9])]).T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "PCA(copy=True, iterated_power='auto', n_components=1, random_state=None,\n",
       "  svd_solver='auto', tol=0.0, whiten=False)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.decomposition import PCA\n",
    "lower_dim = PCA(n_components=1)\n",
    "lower_dim.fit(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.96318131])"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lower_dim.explained_variance_ratio_"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "降维后留下0.96信息量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.82797019],\n",
       "       [ 1.77758033],\n",
       "       [-0.99219749],\n",
       "       [-0.27421042],\n",
       "       [-1.67580142],\n",
       "       [-0.9129491 ],\n",
       "       [ 0.09910944],\n",
       "       [ 1.14457216],\n",
       "       [ 0.43804614],\n",
       "       [ 1.22382056]])"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 降维之后的数据\n",
    "lower_dim.fit_transform(data)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### sk-learn中PCA算法用到是奇异值分解"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 自己实现一个PCA方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(array([[-0.82797019],\n",
      "       [ 1.77758033],\n",
      "       [-0.99219749],\n",
      "       [-0.27421042],\n",
      "       [-1.67580142],\n",
      "       [-0.9129491 ],\n",
      "       [ 0.09910944],\n",
      "       [ 1.14457216],\n",
      "       [ 0.43804614],\n",
      "       [ 1.22382056]]), array([0.0490834 +0.j, 1.28402771+0.j]))\n"
     ]
    }
   ],
   "source": [
    "def myPCA(data, n_components=1000000):  # 默认取所有维度\n",
    "    # data中针对列计算均值\n",
    "    mean_vals = np.mean(data, axis=0)\n",
    "    # 每列分别减去均值\n",
    "    mid = data - mean_vals\n",
    "    # 求协方差 np.cov， rowvar=False针对列\n",
    "    cov_mat = np.cov(mid, rowvar=False)\n",
    "    from scipy import linalg # 线性计算\n",
    "    # 求协方差矩阵的特征值 和 特征向量\n",
    "    eig_vals, eig_vects = linalg.eig(np.mat(cov_mat))\n",
    "    # np.argsort得到排序后的索引\n",
    "    eig_val_index = np.argsort(eig_vals)\n",
    "    # 取最大索引\n",
    "    eig_val_index = eig_val_index[:-(n_components+1):-1]\n",
    "    # 取特征向量\n",
    "    eig_vects = eig_vects[:, eig_val_index]\n",
    "    # 转换后的特征\n",
    "    low_dim_mat = np.dot(mid, eig_vects)\n",
    "    return low_dim_mat, eig_vals\n",
    "print(myPCA(data, n_components=1))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "结果一致，哦耶！"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 基于HR.csv数据做主成分分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([9.98565340e-01, 8.69246970e-04, 4.73865973e-04, 4.96932182e-05,\n",
       "       2.43172315e-05, 9.29496619e-06, 8.24128218e-06])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# HR.bak.csv是清洗过后的数据\n",
    "df = pd.read_csv('HR.bak.csv')\n",
    "my_pca = PCA(n_components=7)\n",
    "lower_mat = my_pca.fit_transform(df.drop(labels=['salary','department','left'], axis=1))\n",
    "my_pca.explained_variance_ratio_"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "得出相关系数，比较后，只留下salary一列即可"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x7f333cba1c88>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWQAAAD8CAYAAABAWd66AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHd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UnI88AZfdvbgIMTimUqNP3ZPwH+sKr+dNLxDNL8E/dO4JIJhwLwauCNTb/2RuDiJP9lsiH1VNXB5r+PAx+n18KbtHlgvu9fNzfRS9Aaw7Qk5H3AmUle0tw8eDNw84Rjaq3mxtn1wP6q+p1Jx9MvyYuSnNysPw/4KeAvJhsVVNU7q2pbVW2n9//X/6iqn5twWCTZ3NyYpWkJvBaY+IyeqvoG8GiSH252/SQw8ZvG024qXr9ZVUeSXAXcBswCe6rqwQmHBUCSG4CLgFOTzAPXVtX1k42KVwNvA77c9GoB/k1V3TLBmI46HfhoM3NmBvhYVbVmilkLnQZ8vPc3lg3AH1XVrZMN6W/8EvCHTZH0CHDlhOOZelMx7U2STgTT0rKQpM4zIUtSS5iQJaklTMiS1BImZElqCROyJLWECVmSWsKELEkt8f8Bky1JgfdFY+0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.heatmap(pd.DataFrame(lower_mat).corr(), vmin=1, vmax=1, cmap=sns.color_palette('RdBu', n_colors=128))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 交叉分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Ttest_indResult(statistic=-1.0601649378624074, pvalue=0.2891069046174478)\n"
     ]
    }
   ],
   "source": [
    "# indices获得索引\n",
    "df_indices = df.groupby(by='department').indices\n",
    "sales_values = df['left'].iloc[df_indices['sales']].values\n",
    "technical_values = df['left'].iloc[df_indices['technical']].values\n",
    "# t分布校验\n",
    "print(ss.ttest_ind(sales_values, technical_values))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZ4AAAE1CAYAAADX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LJCHpRRFxh6SNR/qihqPKNXIq9tqI2Kdh+yt5xmWzyrSaY8tsqB7Md/mfA1wi6Vzg4RG+puH6GfBD0rQyuwE/Z8m9L3X2rKSd+jYk7UhasdOsMm5qs0JJ2pW0AukfI6LQlTqrVOUaOVWStCUpifaNansCOKisWRnMWnFTmxUqIi4ffK9aqGyNnKrk97NxRGyZR7UREf8c5DCzwrnGY9bCSK6RUyZJV0TELoPvaVYeJx6zFiRNIt0Y27hGTlk3dVZG0pGkPp0zgaf7yj3RpVXJiceshSrXyKlSnh1hmf/pu2C0ntWI+3jMWqtsjZyKTSCtK7MTKQFdCfxoRK/IVjiu8Zi1UMUaOSNB0q9JyzafnosOBNaMiP1H7qpsReMaj1lrHyKtkbMyDWvkALVOPORRbQ3bl0maPWJXYyskJx6z1rasao2cit0iafuIuA5A0nZ46WarmBOPWWtVrpFTpe2A/5B0f95eH7i9b2nsuo/as3pwH49ZC5JuB14LVLFGTmX6W4KhT91H7Vk9OPGYtTASa+SYrSiceMzMrFKendrMzCrlxGNmZpVy4jEzs0o58ZiZWaWceMzMrFL/H1WCds1rfCv0AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "df_keys = list(df_indices.keys())\n",
    "# 初始化一个为0的矩阵\n",
    "df_t_mat = np.zeros([len(df_keys), len(df_keys)])\n",
    "for i in range(len(df_keys)):\n",
    "    for j in range(len(df_keys)):\n",
    "        p_value = ss.ttest_ind(df['left'].iloc[df_indices[df_keys[i]]].values, \n",
    "                               df['left'].iloc[df_indices[df_keys[j]]].values)[1]\n",
    "        # 这样做图颜色对比更明显\n",
    "        if p_value < 0.05:\n",
    "            df_t_mat[i][j]=-1\n",
    "        else:\n",
    "            df_t_mat[i][j] = p_value\n",
    "sns.heatmap(df_t_mat, xticklabels=df_keys, yticklabels=df_keys)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "所有黑色部分可以认为部门之间离职率是有显著差异的，例如IT部门和technical部门"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Work_accident</th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>promotion_last_5years</th>\n",
       "      <th>salary</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">0</th>\n",
       "      <th>high</th>\n",
       "      <td>0.082996</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>low</th>\n",
       "      <td>0.331728</td>\n",
       "      <td>0.090020</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>medium</th>\n",
       "      <td>0.230683</td>\n",
       "      <td>0.081655</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">1</th>\n",
       "      <th>high</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>low</th>\n",
       "      <td>0.229167</td>\n",
       "      <td>0.166667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>medium</th>\n",
       "      <td>0.028986</td>\n",
       "      <td>0.023256</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Work_accident                        0         1\n",
       "promotion_last_5years salary                    \n",
       "0                     high    0.082996  0.000000\n",
       "                      low     0.331728  0.090020\n",
       "                      medium  0.230683  0.081655\n",
       "1                     high    0.000000  0.000000\n",
       "                      low     0.229167  0.166667\n",
       "                      medium  0.028986  0.023256"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 透视表是另一种交叉分析方法\n",
    "piv_tb = pd.pivot_table(df, values='left', index=['promotion_last_5years', 'salary'],\n",
    "                       columns=['Work_accident'], aggfunc=np.mean)\n",
    "piv_tb"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "可以得出0.331728的值比较高，过去5年没有晋升，工资比较低，没有事故，这样的人离职率高。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZUAAAELCAYAAAARNxsIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3XmcHVWZ//HPt5tdICCLOiFOAiQwEdkMe0RQwMDPARFeLKICAhlUBHWiP5xRQJgZcRxlYEQwYgyghk3RqAyLCoQlQAKELAgaQzAtCCIYkMiS5Jk/qhoqN7f7VnXXvbdu5/v2Va++tZ16umn7yTmnzjmKCMzMzMrQ1e4AzMxs6HBSMTOz0jipmJlZaZxUzMysNE4qZmZWGicVMzMrjZOKmdkaStIUSU9Lmt/HeUm6SNJCSXMl7dqoTCcVM7M111RgQj/nDwZGp9tE4JJGBTqpmJmtoSJiBvBsP5ccBlwRiXuATSS9pb8y1yozwDVR/HGhpySw1WjjLdodglXRBsM02CJO1ca5/+Z8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AmJE1gM4EZwNGSuiVtQVIruK+Psl4hab76iKQP9vPMYcCTEbES+DDQ29F/M/BRSRsASHpjRDwP9Eh6f3ps3d7zGTOA49LzOwA7psfvAfaRtG16bgNJY+jfC8BGDa4xK5WTig0l80j6Su6pObY0Ip4BrifpW3kI+BXwuYj4Y1+FRcSLJEnq05IO6+OybwLHS7qHpOnrxfTeG0nWlJktaQ4wKb3+w8DpabPW3cCba8q7BNgwPf850qQXEX8CTgCmpefuAbbv96cBPwUOd0e9tZKnvjczs9K4pmJmZqVxh55ZDpLeC3yl5vBjEXF4O+Ixqyo3f5mZWWnc/GVmZqVxUjEzs9I4qZiZWWmcVMzMrDT/B+VLcfReo+ylAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.heatmap(piv_tb, vmin=0, vmax=1, cmap=sns.color_palette('Reds', n_colors=256))\n",
    "sns.set_context(font_scale=1.5)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 分组分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/f/anaconda3/lib/python3.7/site-packages/scipy/stats/stats.py:1713: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.\n",
      "  return np.add.reduce(sorted[indexer] * weights, axis=axis) / sumval\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodH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ey3Hjh1j1apV9O7dm/LlyxMQEJDtuRu+YsnCGFPixMbGsnTpUtasWcPmzZuJiooiIiICkQtnIVLVC8pze4peFve6Oac5L1u2bL72cbE2/v7+pKen57ttYbJkUUxMuq9ftp9TRx2Pezx19IirzBjjkJycTJUqVahQoQI7d+5k7dq1/Pbbbyxfvpz4+HgA12mozp07M336dFfbX375hZtvvpnly5dz4sQJMjIy+OSTT2jfvj0A1113HT/99BOZmZnMnz/fYywBAQGcPn36kuJv06YNCxcuJDU1lTNnzrie+OdLV+01C2Nav94623qZpDL44cfBpIOubd8/9r0vQitxCnuoa9euXXn77bcJDw+nQYMGtGjRgho1ajBjxgz69u1LZmYm1157Ld988w1/+ctfGD58OKGhofj7+/PCCy/Qt29f/va3vxETE4Oqctttt9G7d28AJk+eTI8ePbjxxhsJDQ31+GyL8PBwSpUqRUREBIMHDyYqKspj/M2aNaNXr15ERETwhz/8gejoaAIDAwvks7lclizyKT9TXNs02MYUDWXLluXLL7/MdVu3bt2yrVeqVIkPPvjggnoDBgxw3Rvhrl+/fvTrd2FP3n2qc8CVREqXLs23336bbVuHDh0Ax2god9u2bXMtP/PMM4wfP55z587Rrl07nn766VzfT2GxZJFP+XnmhT0XwxhTUIYNG8aOHTtITU1l0KBBNGnSxKfxWLIowaynY0zx5X4jX1FgyaIEs56OMaag2GgoY4wxHlnPwlzgsznNXctnzlQE/Dhz5mC28rvuXOeDyIwxvmLJAsgsUzHbqzHGmOwsWQBn63X2dQjGlGg572m5Up7uf0lISKBHjx7ZhqKaK2PJogiqWOaabK/GmIKXnp5OqVL2FZhfXr3ALSJdRWSXiOwVkdG5bH9YRLaKyCYRWSUijd22Pedst0tEungzzqKm9U196dxoMK1v6uvrUIwptjIyMhg6dCghISF07tyZlJQUOnTowPPPP0/79u35xz/+4esQixWvJQsR8QfeALoBjYF73JOB0yxVDVPVSGAK8IqzbWOgPxACdAXedO7PGGPyZc+ePQwfPpzt27dTuXJl13MqkpKSWL58uc/viC5uvNmzaA7sV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MMXEynsakp5P9j7VyFzm2+3Hdj20Khvtnm4HbKUMu8v8wj7Yl+vdiPYuiaQWO53r4i0gNHH+pZk13sgZ40llnJfCM89UUvq+Bx5zT6iMiUc7yFcC9zrJQIDyXtseAa0WkmoiUBXoUQrzm0uwE6ro9lO1u34XieyU6ExZj83GcWtqM4y/UUap61LltJdBZVfeKyP9w9C4sWfjGROA1YIszYSTg+NJ/C3hPRLYAm8hlXjNVTXNOffMDEI/ji8kUIaqaIiKPAl+JyAmu8vnp7A5uY4y5CBGppKpnnH8MvAHsUdVXfR2XL9hpKGOMubihzgEM23E8QuEdH8fjM9azMMYY45H1LIwxxnhkycIYY4xHliyMMcZ4ZMnCGC9wn1/ImJLAkoUxRYCI2D1Ppkizf6DG5JOIVAQ+A2rjeK78RKAB0BPHNBGrgT9pjiGGIjIutzoiEutcbw18JyKDgfrOG/auwTGnVL2SPDmdKT6sZ2FM/nUFDqtqhKqGAl8B01W1mXO9PLlP25FXncqq2l5V/4pjMsLuzvL+wDxLFKaosGRhTP5tBW4Rkb+LSFtVTQZiROQHEdkKdARCcmmXV53Zbsv/BB5wLj8AvFfwb8GYy2OnoYzJJ1XdLSJNgduAv4nIEmA4EK2qB50PL8o2e6zzmQhv5lHnrNv+v3c+FKk94K+qFzzy0xhfsZ6FMfkkIjVxPNToI2Aq0MS56YSIVAJyG/1ULh913H2I47kJ1qswRYr1LIzJvzDgZRHJBNKAR4A+OE5PJeB4ml42qpokIu/mVSeHj4EXufBBO8b4lM0NZUwR4rw3o7eqDvR1LMa4s56FMUWEiLwOdMNxTcSYIsV6FsYYYzyyC9zGGGM8smRhjDHGI0sWxhhjPLJkYYwxxiNLFsYYYzyyZGGMMcaj/weQF1ARLRSNzAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.barplot(x='salary', y='left', hue='department', data=df)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "可以看出图中两个拐点，可以以此进行分析"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 相关分析(除相关系数外，熵也是一个很重要的因素)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
